import bisect
import copy
import heapq
import itertools
import json
import math
from collections import deque, Counter, defaultdict
from functools import cache
from heapq import heappop, heappush
from itertools import accumulate
from math import inf
from typing import List, Optional
from sortedcontainers import SortedList, SortedSet
import re

'''
最多有连续limit个0或者1
limit = 4
'''


MOD = 1_000_000_007
MAX = 400
class Solution:
    def countKeyChanges(self, s: str) -> int:
        s = s.lower()
        ans = 0
        for i in range(1, len(s)):
            if s[i - 1] != s[i]:
                ans += 1
        return ans











